﻿// Unity Finnal Build Render Pipeline

using UnityEngine;
using UnityEngine.Rendering;

public partial class CameraRender
{
#if DEVELOPMENT_BUILD

    partial void DrawVisableGeometry()
    {
        var sortingSettings = new SortingSettings(camera)
        {
            criteria = SortingCriteria.CommonOpaque
        };
        var drawingSettings = new DrawingSettings(customShaderTagId, sortingSettings);
        var filteringSettings = new FilteringSettings(RenderQueueRange.opaque);

        context.DrawRenderers(cullingResults, ref drawingSettings, ref filteringSettings);

        context.DrawSkybox(camera); // this is first draw skybox
        // now draw transparents object

        sortingSettings.criteria = SortingCriteria.CommonTransparent;
        drawingSettings.sortingSettings = sortingSettings;
        filteringSettings.renderQueueRange = RenderQueueRange.transparent;

        context.DrawRenderers(cullingResults, ref drawingSettings, ref filteringSettings);
    }
    partial void DrawUnsupportShaders()
    {
        var drawingSettings = new DrawingSettings(
              UnSupportShaderTagIds[0], new SortingSettings(camera)
            );
        for (int i = 1; i < UnSupportShaderTagIds.Length; i++)
        {
            drawingSettings.SetShaderPassName(i, UnSupportShaderTagIds[i]);
        }
        var filteringSettings = FilteringSettings.defaultValue;
        context.DrawRenderers(cullingResults, ref drawingSettings, ref filteringSettings);

    }

#endif
}
